Creates a shortcut (.lnk) to a file.
FileCreateShortcut ( "file", "lnk" [, "workdir" [, "args" [, "desc" [, "icon" [, "hotkey" [, icon number [, state]]]]]]] )
Parameters
file | Full path and file name of file to create shortcut to. |
lnk | Full path and file name of the shortcut. |
workdir | [optional] Working directory. |
args | [optional] Additional file arguments. |
desc | [optional] File Description. |
icon | [optional] Full Path/File name of icon to use. |
hotkey | [optional] Hotkey - same as the Send() key format. |
icon number | [optional] The icon instance to use (usually 0) |
state | [optional] The state the shortcut is launched in. Use either @SW_SHOWNORMAL, @SW_SHOWMINNOACTIVE or @SW_SHOWMAXIMIZED |
Return Value
Success: | Returns 1. |
Failure: | Returns 0 if lnk cannot be created. |
Remarks
Hotkeys for windows shortcuts are of the following form: Ctrl+Alt+X, Ctrl+Shift+X, Shift+Alt+X, Ctrl+NumPadKey, or Alt+NumPadKey where X represents a letter, number, punctuation, or function key. If you specify an invalid form, Windows typically defaults to Ctrl+Alt
Related
FileGetShortcut
Example
; Sets a shortcut with ctrl+alt+t hotkey
FileCreateShortcut(@WindowsDir & "\Explorer.exe",@DesktopDir & "\Shortcut Test.lnk",@WindowsDir,"/e,c:\", "This is an Explorer link;-)", @SystemDir & "\shell32.dll", "^!t", "15", @SW_MINIMIZE)